<template>
  <a-modal v-model:visible="visible" forceRender :footer="null"  wrap-class-name="error-full-modal" width="100%">
    <iframe ref="iframe" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>
  </a-modal>
</template>

<script>
export default {
  name: "errorPage"
}
</script>
<script setup>
import {useInjectState} from '@/store/index'
const state = useInjectState()
import {ref, watch} from "vue";
const visible = ref(false)
const iframe = ref()
watch(()=>state.errorData,value=>{

  const iframeDoc = iframe.value.contentDocument || iframe.value.contentWindow.document
  iframeDoc.open();
  iframeDoc.write(value);
  iframeDoc.close();
  visible.value = true
})
</script>
<style lang="less">
.error-full-modal {
  iframe{
    display: block;
  }
  .ant-modal {
    max-width: 100%;
    top: 0;
    padding-bottom: 0;
    margin: 0;

  }
  .ant-modal-content {
    max-height: 100vh;
    height: 100vh;
  }
  .ant-modal-body {
    flex: 1;
    padding: 0;
  }
}
</style>
